package com.tran.app.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.tran.app.data.Course

@Dao
interface CourseDao {
    @Insert
    fun insert(course: Course)

    @Update
    fun update(course: Course)

    @Delete
    fun delete(course: Course)

    @Query("SELECT * FROM Course WHERE techaccount = :techaccount")
    fun getCoursesByTechName(techaccount: String): List<Course>

    @Query("SELECT * FROM Course")
    fun getCourses(): List<Course>

    @Query("SELECT * FROM Course WHERE name = :Cname")
    fun getCoursesByCName(Cname: String): List<Course>

    @Query("SELECT * FROM Course WHERE id = :id")
    fun getCoursesById(id: Int): Course
    // 其他查询方法...
}